{% extends "base.volt" %}

{% block pageFooter%}
    {# {{ javascript_include("/assets/manage/js/sys/opLog.js", false) }} #}
{% endblock %}

{% block content %}
    {{ partial("module/left_sys") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li>系统管理</li>
            <li><a href="{{ url.get('sys/opLog') }}">操作员管理</a></li>
            <li class="active">操作日志</li>
        </ol>

        <div class="panel panel-default">
            <div class="panel-body">
                <form class="form-inline" role="form" action="" method="get">
                    <div class="form-group">
                        <div class="input-group">
                            <label class="input-group-addon" for="filterOp">操作员:</label>
                            <select class="form-control" name="filterOp" id="filterOp">
                                <option value="-10000" {{ filterOp == -10000 ? 'selected="selected"' : '' }} >全部</option>
                                {% for op in opList  %}
                                    <option value="{{ op.operator_id }}" {{ filterOp == op.operator_id ? 'selected="selected"' : '' }} >{{ op.operator_show_name }}</option>
                                {%  endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <label class="input-group-addon" for="filterType">操作类型:</label>
                            <select class="form-control" name="filterType" id="filterType">
                                <option value="-10000" {{ filterType == -10000 ? 'selected="selected"' : '' }} >全部</option>
                                {% for t in opLogTypes %}
                                <option value="{{ t.type_id }}" {{ filterType == t.type_id ? 'selected="selected"' : '' }} >{{ t.type_title }}</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> 搜 索</button>
                    </div>
                </form>
            </div>
        </div>

        <table class="table table-hover">
            <thead>
            <tr>
                <th style="width: 60px;">ID</th>
                <th style="width: 120px;">操作员</th>
                <th>操作类型</th>
                <th style="width: 200px;">IP</th>
                <th style="width: 160px;">操作时间</th>
                <th style="width: 200px;"></th>
            </tr>
            </thead>
            {% for d in data %}
                <tr>
                    <td>{{ d.log_id }}</td>
                    <td>{{ d.operator_show_name|e }}</td>
                    <td>{{ d.log_type|e }}</td>
                    <td>{{ json_decode(d.log_client_info, true)['ip'] }}</td>
                    <td>{{ d.log_addtime }}</td>
                    <td>
                    </td>
                </tr>
            {% endfor %}
        </table>

        {{ this.tagNav.page(
        page,
        total,
        limit,
        url.get('sys/opLog', [
        'filterOp': filterOp,
        'filterType': filterType,
        'page': '__PAGE__'
        ]
        )) }}
    </div>
{% endblock %}